import User from '@/service/app/user'

export default {
  isAdmin (state) {
    return state.account.admin
  },

  isOperator (state) {
    let type = state.account.type
    return type === User.types.OPERATOR
  },

  hasPerm: (state) => (id) => {
    return state.perms.findIndex(perm => perm.perm === id) >= 0
  }

}
